##-*- coding: utf-8 -*-

import os
from portscan import startScan
from connectionsScan import startConnectionsScan
from logAnalyser import startLogAnalyser

"""
Projeto: Aplicacao de Seguranca Informatica
Mestrado em Engenharia de Segurança Informática
Disciplina: Linguagens de Programacao Dinamicas

Alunos: Luis Sobral-12830 
	Carlos Marcelino - 13244
maio 2013
"""

os.system("clear")
print("********** LPD Project **********")
print("*    Security Scan Program      *")
print("*********************************")

"""
Funtions that selects the file to be used,
depends of the user selected option
"""
def portScan():
	startScan()

def connectionsScan():
	startConnectionsScan()

def logAnalyzer():
	startLogAnalyser()

inputOption = 1 

"""
This cycle shows the first menu of the application, and
controls the option selected by the user
"""
while inputOption > 0:
	print(" 1 - Port Scan")
	print(" 2 - Connections Scan")
	print(" 3 - Firewall Log Analyzer")
	print(" Something else - Quit")

	try: inputOption = int(raw_input('\n Input selected option: '))
	except: inputOption = 0

	if inputOption == 1:
		portScan()
	elif inputOption == 2:
		connectionsScan()
	elif inputOption == 3:
		logAnalyzer()
	else:
		break

"""
If the user select other value than the options showed, the program terminate
"""	
os._exit(1)

